<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <label>
            <img src="" alt="">
        </label>
        <input type="password" id="pwd">
    </div>
</body>
</html>
<script>
    var eye=document.getElementById('eye')
    var pwd=document.getElementById('pwd')
    eye.onclick=function(){
        if(pwd.type=='password'){
            pwd.type='text'
            eye.scr='img'
        }else{
            pwd.type='pssword'
            eye.src=''
        }
    }
</script>